<?php
/**
 * Created by PhpStorm.
 * User: zyark
 * Date: 2017/8/15
 * Time: 08:42
 */

namespace Admin\Model;


use Think\Model;

class UserModel extends Model
{
    /**
     * 分页条件查询
     * @param $map 查询条件
     * @param $pagenumber 页号
     * @param $pagesize 页面大小
     * @return mixed
     */
    public function getByConditionPage($map, $pagenumber, $pagesize)
    {
        $startno = ($pagenumber - 1) * $pagesize;
        $limit = $startno . ',' . $pagesize;//每页的数据数和内容$limit
        $list = $this->where($map)->limit($limit)->order('t_user.id desc')->select();
        foreach ($list as $key=>$value){
            $list[$key]['create_time'] = date('Y-m-d H:i',$value['create_time']);
        }
        return $list;
    }

}